using UnityEngine;
using System.Collections;
using DICE_GS;

public class uiRollButton : uiBaseButton {
	
	[HideInInspector] public CPawnWrapper pawn;
	// Use this for initialization
	void Start () {
	
	}
	
	void OnClick()
	{
		glog.debug("rollbutton OnClick");

		if (CNetworkManager.Instance.Connected)
        {
            //CNetworkManager.Instance.SendRequest("RollDice");
            PC_CS_ROLL_DICE packet = new PC_CS_ROLL_DICE();

            packet.ServerID = pawn.SID;
            packet.DiceType = (byte) DiceType.DICE_MOVE;

            //CNetworkManager.Instance.SendPacket(packet.Protocol, packet.GetParam());
			CNetworkManager.Instance.SendPacket(packet);
        }
		
		gameObject.GetComponent<UIImageButton>().isEnabled = false;
	}	

}
